<?php
/**
 * <https://y.st./>
 * Copyright © 2018 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'<{title}>' => 'An hour early ...',
	'takedown' => '2017-11-01',
	'<{body}>' => <<<END
<section id="drudgery">
	<h2>Drudgery</h2>
	<p>
		I had a pretty hard time trying to get myself to work on coursework today.
		My task for the day was to complete the assigned reading material for the maths course.
		It wouldn&apos;t be too bad, as the maths course isn&apos;t so bad, but I just didn&apos;t want to do it.
		I had to remind myself that I&apos;d completed the initial post for the discussion assignment without even <strong>*looking*</strong> at the reading assignment.
		Clearly, this week would be review.
		Nothing even remotely difficult.
		By the time I got started though, I made a mistake and thought I was running late for heading to work.
		Instead, I made it an hour early.
		Ugh.
		I could&apos;ve used that study time.
		It&apos;d be enough to get most of the maths reading done.
	</p>
	<p>
		I also continued with my professor, who gave me their email address, but also claimed that clicking on their name would&apos;ve given me their email address:
	</p>
	<blockquote>
		<p>
			Done, sent.
			That said, clicking on your name brings up your profile, which as I said before, doesn&apos;t contain your email address.
			It has a non-email messaging option, but that&apos;s been broken since the last remodel of that section of the website.
		</p>
	</blockquote>
	<p>
		I continued the maths discussion:
	</p>
	<blockquote>
		<p>
			It took me a bit to figure out what you meant.
			I&apos;d forgotten that &quot;5% per year&quot; doesn&apos;t actually mean 5% per year, often times.
			It&apos;s a lie of simplification.
			Sometimes it means 5/12% per month, which when calculated out, doesn&apos;t work out to the stated 5% per year (it&apos;s more like 4.16, 6 repeating per year; the bank&apos;s ripping you off).
			You&apos;re right, my calculation only works for the literal 5% per year.
			It takes into account the compounded interest, but only if that interest is compounded annually.
			The exponent ensures the (per year) interest is carried over and accounted for in the next year though.
		</p>
	</blockquote>
	<p>
		Then finally, I made my actual discussion post for the day in the same discussion:
	</p>
	<blockquote>
		<p>
			Thanks for showing us how to use the equation for continuously compounding interest!
			I hadn&apos;t considered that the interest might not be calculated at set intervals, but instead increase the running total at all times.
			Without further details, there are a lot of ways to look at the problem, so there are multiple potential methods and solutions.
			This really shows you need to look at more than just the interest rate&apos;s numbers when deciding which sort of savings account to get.
		</p>
	</blockquote>
</section>
<section id="Minetest">
	<h2>Minetest</h2>
	<img src="/y.st./source/y.st./static/img/CC_BY-SA_3.0/minetest.net./weblog/2018/03/04.png" alt="The beginnings of the walls" class="framed-centred-image" width="800" height="600"/>
	<p>
		I dug out around the edges of where my tunnel will be, then started building the walls to hold back the waters.
		It&apos;ll be nice to have a dry floor again.
		Water used to not be so bad, but changes in the Minetest engine have made wading a drag.
		Literally.
		Water holds you back, making you drag substantially.
	</p>
	<p>
		At work, I thought more about the automated shop I want to program for the game.
		It devolved in my mind, then devolved again.
		At this point, the plan is to build some very specific code that will likely see no use whatsoever on any one else&apos;s server.
		Still, it&apos;ll meet my needs, and there are plenty of other shop mods for other administrators to install if they want something better suited for general use.
		Anyway, the plan is this: I&apos;ll set up a shop with very specific, hard-coded barter exchange options.
		You can only barter for certain items at a server shop.
		To barter for a given item, you&apos;ll need to have already encountered that item elsewhere.
		Each buyable item will cost a certain number of a specific other item.
		Users can craft their own shop nodes or they can craft server shop nodes.
		Server shop nodes all provide the same exact options, all of which are hard-coded by me.
		(If I&apos;m feeling up to it, I might make this configurable instead of hard-coding, but this is made more complex by the fact you&apos;ll need to have encountered an item already to buy it.)
		The items for sale will be the most basic form you can have in inventory, and you can use those simple items to craft the more complex items.
		In the case of minerals, the shop will check to see if you&apos;ve encountered the material by asking <code>minestats</code> if you have any of that mineral mined.
		For other items, a special flag will be set when you mine that material.
	</p>
	<p>
		The material flags are less than ideal in some cases.
		Such as coral.
		I&apos;d really rather have <code>minestats</code> just count coral.
		With the new $a[API] capabilities of <code>minestats</code>, I can have it do just that.
		I really don&apos;t want to hard code the coral node into <code>minestats</code> proper, I&apos;d rather have <code>minestats</code> be fully dynamic, but it&apos;d be perfectly acceptable to have the shop mod instruct <code>minestats</code> from the outside to keep track of coral.
		That got me thinking though about exactly what <code>minestats</code> should and should not count.
		It&apos;s a fact that I can&apos;t program <code>minestats</code> to automatically capture all of what I want captured and none of what I don&apos;t.
		Parts of the semantics of one mod can&apos;t be seen in another mod.
		However, there aught to be a way to define as a hand-testable concept what should and should not be counted.
		At first, I thought the test was whether the mining of the node was reversible.
		That seemed to capture everything <code>minestats</code> automatically captures as well as coral.
		However, that definition does have a small flaw.
		In some cases, some things I want counted are in fact a reversal.
		For example, if a farm plant drops one seed and nothing else, it has in fact reverted back to what it was before you planted it.
		That of course means it could once again become that plant; it&apos;s a reversal, so it&apos;s reversible by going back in the forward direction.
		However, I didn&apos;t want to count seed drops in some cases but not others.
		It would seem ... like <code>minestats</code> was broken.
		Or overly pedantic.
		Either I&apos;d failed to capture the semantics of what I want counted or my entire premise was flawed.
		I hoped against the latter.
		On my way home though, I finally formalised what I believe is the semantics of what I want counted.
		<code>minestats</code> should count a drop if, given we know what stack was dropped and we don&apos;t know if it was dropped alongside any other stacks, the mining <strong>*could*</strong> be irreversible.
		We know everything about what could happen (including what sets of stacks could be dropped together), but we don&apos;t know what <strong>*did*</strong> happen.
		This definition allows us to consistently count seed drops.
	</p>
	<p>
		Having a definition of what semantically should be counted allows me to test how well <code>minestats</code>&apos; detection code works with a given set of mods (such as those of Minetest Game) as long as I know those mods well enough.
		I was curious to see how well <code>minestats</code> lives up to this.
		Does it miss anything but coral?
		As it turns out, only three things are missed: the two corals, as well as dirt with grass and footsteps.
		The footstep grass is unobtainable, but if it was somehow encountered (such as with the <code>/giveme</code> command), it could be dug but could never return to its footstep grass state, as that state isn&apos;t supposed to exist.
		In fact, why is that node still in the game?
		While we&apos;re at it, why is the cloud node still there too?
		It&apos;s worth slightly altering our definition of what should be counted though.
		The node should be encounterable without magic powers such as creative mode or the <code>/giveme</code> command.
		That means <code>minestats</code> is very well tuned to Minetest Game, missing only coral, which I&apos;m pretty sure cannot be distinguished from nodes such as dirt and its various forms.
		I&apos;ve already seen it fail with certain mods that define things very strangely (<em>*cough* <code>pipeworks</code> *cough*</em>), but it does its job well with the default setup.
	</p>
</section>
END
);
